#myapp的urls.py
from django.urls import path
from . import views
from django.urls import re_path
from django.views.generic import RedirectView

app_name = 'myapp'  # 设置命名空间

urlpatterns =[
    #带参数的路由，接收两个整数
    path('<int:num1>/<int:num2>',views.sum,name='sum'),
    path('',views.myapp,name='myapp'),
     #设置路由跳转
    path('turnTo', RedirectView.as_view(url='/'), name='turnTo'),
    #不带参数的路由
    path('',views.zero,name='zero'),
    #带参数的路由，接收两个整数
    path('<int:num1>/<int:num2>',views.sum,name='sum'),
    #正则表达式路由
    re_path('(?P<id>(post-)[0-9]*).html',views.post_num,name='post_num')

]